function hotPotato (nameList, num) {
  let arr = [...nameList],
    eliminated = ''
  while (arr.length > 1) {
    for (let i = 0; i < num; i++) {
      arr.push(arr.shift())
    }
    eliminated = arr.shift()
    console.log(eliminated + '被淘汰')
  }
  console.log('胜出者' + arr[0])
}

let names = [' John', ' Jack', ' Camila', ' Ingrid', ' Carl']; hotPotato(names, 7)
